package cn.dubito.miaosha.utils;

import org.springframework.util.StringUtils;

import java.util.regex.Pattern;

/**
 * @author liliang
 * @description:
 * @date 2018/3/30.
 */
public class ValidateUtil {

    private static final Pattern MOBILE_PATTERN = Pattern.compile("1\\d{10}");

    public static boolean isMobile(String mobile) {
        return !StringUtils.isEmpty(mobile) && MOBILE_PATTERN.matcher(mobile).matches();
    }

    public static void main(String[] args) {
        System.out.println(isMobile("18107785030"));
    }
}
